package com.mrjoew.weekend.web.api;

import com.mrjoew.weekend.entities.vo.UserInfoVO;
import io.swagger.annotations.Api;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Christopher Jones
 * @ClassName UserApiController
 * @explain
 * @date 2020/6/18 0018 15:22
 */
@Api(tags = "用户")
@RequestMapping(value = "/api/user")
@RestController
public class UserApiController {

    @GetMapping
    public UserInfoVO authentication(Authentication authentication) {
        UserInfoVO userInfoVo = new UserInfoVO();
        userInfoVo.setAccount(authentication.getName());
        return userInfoVo;
    }
}
